<!DOCTYPE html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="/static/css/font.css">
    <!--<link rel="stylesheet" href="/static/css/xadmin.css">-->
    <!--<script src="/static/lib/layui/layui.js" charset="utf-8"></script>-->
    <!--<script type="text/javascript" src="/static/js/xadmin.js"></script>-->
    <script type="text/javascript" src="/static/js/jquery.min.js"></script>
    <!--<script type="text/javascript" src="/static/js/jquery.printarea.js"></script>-->
    <script src="http://www.jq22.com/jquery/jquery-migrate-1.2.1.min.js"></script>
    <script language="javascript" src="/static/js/jquery.jqprint-0.3.js"></script>
    <link rel="stylesheet" type="text/css" media="print,screen" href="/static/css/order.css" />

</head>
<body>
<div class="content">
    <div class="title">
        {$title}
    </div>

    <div class="tou">
        <div class="u">客户: {$user.name}</div>

        <div class="g">送货单 <p>联系电话:{$user.phone}</p></div>

        <div class="t">
            <p>单据编号:{$orders.order_number}</p>
            <p>单据日期:<?php echo date('Y-m-d H:i:s',time())?></p>
        </div>

    </div>

    <div class="tb" >
        <table id="tab">
            <thead>
            <tr>
                <th>商品名</th>
                <th class="sw">数量</th>
                <th class="sw">规格</th>
                <th class="sw">单位</th>
                <th class="sw">单价</th>
                <th>金额</th>
                <th>备注</th>
            </tr>
            </thead>
            <tbody>
            {volist name="goods" id="v"}
            <tr>
                <td>{$v.name}</td>
                <td>{$v.num}</td>
                <td>{$v.specs}</td>
                <td>{$v.unit}</td>
                <td>{$v.price}</td>
                <td >{$v.num * $v.price}元</td>
                <td>{$orders.remark}</td>
            </tr>
            {/volist}
            <!--<tr class="k">-->
                <!--<td></td>-->
                <!--<td></td>-->
                <!--<td></td>-->
                <!--<td></td>-->
                <!--<td></td>-->
                <!--<td></td>-->
                <!--<td></td>-->
            <!--</tr>-->
            <tr>
                <td >客户签字:</td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td>￥{$orders.total_price}元</td>
                <td></td>
            </tr>
            </tbody>
        </table>

    </div>


    <br>
    <div style="width: 90%;font-size: 16px; margin-left: 1.5%">
       天津市西青区创新六路华鼎新区1号  电话:0558-1234567 传真:0558-1234567
    </div>

</div>
<br><br>
<div class="layui-form-item">
    <button class="layui-btn">打印出库单</button>
</div>
<script>

    $(document).ready(function(){
        $(".layui-btn").click(function(){
            // $(".content").printArea();
            $(".content").jqprint();
        });


        (function ($) {
            $.fn.extend({
                //表格合并单元格，colIdx要合并的列序号，从0开始
                "rowspan": function (colIdx) {
                    return this.each(function () {
                        var that;
                        $('tr', this).each(function (row) {
                            $('td:eq(' + colIdx + ')', this).filter(':visible').each(function (col) {
                                if (that != null ) {
                                    rowspan = $(that).attr("rowSpan");
                                    if (rowspan == undefined) {
                                        $(that).attr("rowSpan", 1);
                                        rowspan = $(that).attr("rowSpan");
                                    }
                                    rowspan = Number(rowspan) + 1;
                                    $(that).attr("rowSpan", rowspan);
                                    $(this).hide();
                                } else {
                                    that = this;
                                }

                            });
                        });
                    });
                }
            });
        })(jQuery);
        $("#tab").rowspan(6);
    });
</script>

</body>

</html>